/**
 * Generate time : 2011-06-20 19:56:19
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cm.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCMMaterialRation
 * 
 */
public class ZMCMMaterialRation extends DaoEPBase {

	private String fdKeyId = " "; /* 主键 */
	private String fdDepartmentId = " "; /* 单位主键 */
	private String fdYear = " "; /* 年份 */
	private String fdMonth = " "; /* 月份 */
	private Double fdIntialRation = new Double(0); /* 初始费用额度 */
	private Double fdMonthRation = new Double(0); /* 月费用额度 */
	private Long fdRationChangeNum = new Long(0); /* 额度调整次数 */
	private Long fdExportRation = new Long(0); /* 月领用额度 */
	private Long fdExportMaterialRation = new Long(0); /* 月材料费用领用额度 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDepartmentId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("单位主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdYear");
		eiColumn.setType("N");
		eiColumn.setFieldLength(4);
		eiColumn.setDescName("年份");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdMonth");
		eiColumn.setType("N");
		eiColumn.setFieldLength(2);
		eiColumn.setDescName("月份");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIntialRation");
		eiColumn.setType("N");
		eiColumn.setScaleLength(5);
		eiColumn.setFieldLength(15);
		eiColumn.setDescName("初始费用额度");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdMonthRation");
		eiColumn.setType("N");
		eiColumn.setScaleLength(5);
		eiColumn.setFieldLength(15);
		eiColumn.setDescName("月费用额度");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRationChangeNum");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("额度调整次数");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdExportRation");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("月领用额度");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdExportMaterialRation");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("月材料费用领用额度");
		eiMetadata.addMeta(eiColumn);
	}

	/**
	 * the constructor
	 */
	public ZMCMMaterialRation() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - 主键
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - 主键
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdDepartmentId - 单位主键
	 * 
	 * @return the fdDepartmentId
	 */
	public String getFdDepartmentId() {
		return this.fdDepartmentId;
	}

	/**
	 * set the fdDepartmentId - 单位主键
	 */
	public void setFdDepartmentId(String fdDepartmentId) {
		this.fdDepartmentId = fdDepartmentId;
	}

	/**
	 * get the fdYear - 年份
	 * 
	 * @return the fdYear
	 */
	public String getFdYear() {
		return this.fdYear;
	}

	/**
	 * set the fdYear - 年份
	 */
	public void setFdYear(String fdYear) {
		this.fdYear = fdYear;
	}

	/**
	 * get the fdMonth - 月份
	 * 
	 * @return the fdMonth
	 */
	public String getFdMonth() {
		return this.fdMonth;
	}

	/**
	 * set the fdMonth - 月份
	 */
	public void setFdMonth(String fdMonth) {
		this.fdMonth = fdMonth;
	}

	/**
	 * get the fdIntialRation - 初始费用额度
	 * 
	 * @return the fdIntialRation
	 */
	public Double getFdIntialRation() {
		return this.fdIntialRation;
	}

	/**
	 * set the fdIntialRation - 初始费用额度
	 */
	public void setFdIntialRation(Double fdIntialRation) {
		this.fdIntialRation = fdIntialRation;
	}

	/**
	 * get the fdMonthRation - 月费用额度
	 * 
	 * @return the fdMonthRation
	 */
	public Double getFdMonthRation() {
		return this.fdMonthRation;
	}

	/**
	 * set the fdMonthRation - 月费用额度
	 */
	public void setFdMonthRation(Double fdMonthRation) {
		this.fdMonthRation = fdMonthRation;
	}

	/**
	 * get the fdRationChangeNum - 额度调整次数
	 * 
	 * @return the fdRationChangeNum
	 */
	public Long getFdRationChangeNum() {
		return this.fdRationChangeNum;
	}

	/**
	 * set the fdRationChangeNum - 额度调整次数
	 */
	public void setFdRationChangeNum(Long fdRationChangeNum) {
		this.fdRationChangeNum = fdRationChangeNum;
	}

	/**
	 * get the fdExportRation - 月领用额度
	 * 
	 * @return the fdExportRation
	 */
	public Long getFdExportRation() {
		return this.fdExportRation;
	}

	/**
	 * set the fdExportRation - 月领用额度
	 */
	public void setFdExportRation(Long fdExportRation) {
		this.fdExportRation = fdExportRation;
	}
	
	/**
	 * get the fdExportMaterialRation - 月材料费用领用额度
	 * 
	 * @return the fdExportMaterialRation
	 */
	public Long getFdExportMaterialRation() {
		return this.fdExportMaterialRation;
	}

	/**
	 * set the fdExportMaterialRation - 月材料费用领用额度
	 */
	public void setFdExportMaterialRation(Long fdExportMaterialRation) {
		this.fdExportMaterialRation = fdExportMaterialRation;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdDepartmentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDepartmentId")), fdDepartmentId));
		setFdYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdYear")), fdYear));
		setFdMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdMonth")), fdMonth));
		setFdIntialRation(NumberUtils.toDouble(StringUtils.toString(map.get("fdIntialRation")), fdIntialRation));
		setFdMonthRation(NumberUtils.toDouble(StringUtils.toString(map.get("fdMonthRation")), fdMonthRation));
		setFdRationChangeNum(NumberUtils.toLong(StringUtils.toString(map.get("fdRationChangeNum")), fdRationChangeNum));
		setFdExportRation(NumberUtils.toLong(StringUtils.toString(map.get("fdExportRation")), fdExportRation));
		setFdExportMaterialRation(NumberUtils.toLong(StringUtils.toString(map.get("fdExportMaterialRation")), fdExportMaterialRation));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdDepartmentId", StringUtils.toString(fdDepartmentId, eiMetadata.getMeta("fdDepartmentId")));
		map.put("fdYear", StringUtils.toString(fdYear, eiMetadata.getMeta("fdYear")));
		map.put("fdMonth", StringUtils.toString(fdMonth, eiMetadata.getMeta("fdMonth")));
		map.put("fdIntialRation", StringUtils.toString(fdIntialRation, eiMetadata.getMeta("fdIntialRation")));
		map.put("fdMonthRation", StringUtils.toString(fdMonthRation, eiMetadata.getMeta("fdMonthRation")));
		map.put("fdRationChangeNum", StringUtils.toString(fdRationChangeNum, eiMetadata.getMeta("fdRationChangeNum")));
		map.put("fdExportRation", StringUtils.toString(fdExportRation, eiMetadata.getMeta("fdExportRation")));
		map.put("fdExportMaterialRation", StringUtils.toString(fdExportMaterialRation, eiMetadata.getMeta("fdExportMaterialRation")));

		return map;

	}
}